
var microcircleReviewtableI = null;
function  microcircleReviewtableRefre(){
    microcircleReviewtableI.reload('microcircleReviewtableId');
}
layui.use(['table', 'laydate','form'], function(){
    var table = layui.table,
        laydate = layui.laydate,
        form = layui.form;

    laydate.render({
        elem: '#rq', //指定元素
    });


    microcircleListtableI = table.render({
        elem: '#test',
        url:'/microcycleManagement/getAll',
        id:'microcircleReviewtableId',
        where:{
            sorw : 1
        },
        page:{
            layout:['count','prev','page','next','limit'],
            groups:2,
            limit:10,
            limits:[10,15,20]

        },
        cols: [[
            {field:'id', width: 120, title: '微圈编号',align:'center'},
            {field:'userAccount', width: 180, title: '用户账号',align:'center'},
            {field:'microcircleTime', width: 250, title: '发表时间',align:'center'},
            {field:'fabulousNum', width: 120, title: '点赞人数',align:'center'},
            {field:'commentNum', width: 120, title: '评论人数',align:'center'},
            {field:'reviewStatus', width:120,align:'center', title: '状态',templet: function(row){
                    if(row.reviewStatus == '0'){
                        return '已审核';
                    }else{
                        return '未审核';
                    }
                }},
            {fixed: '', title:'操作', minWidth: 80,toolbar: '#barDemo',align:'center'}
        ]],
        toolbar:'#toolbarDemo',
        skin: 'line',
        parseData:function (res){
            return{
                "code":res.code, // 解析接口状态
                "msg": res.msg, // 解析提示文本
                "count": res.count, // 解析总条数
                "data": res.data // 解析数据列表
            };
        }
    });

    table.on('tool(test)', function(obj){ // 双击 toolDouble
        if(obj.event === 'sh'){
            layer.msg("审核");
        }

    });

    form.on('submit(go)',function (d){
        d = d.field;
        console.log(d);
        table.reload('microcircleReviewtableId',{
            where:{
                userAccount:d.userAccount,
                microcircleTime:d.microcircleTime,
            }
        });
    })


});